-
Notifications
You must be signed in to change notification settings - Fork 586
Fix Potential deadlock in AutorecoveringConnection #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ts consumers and recordedQueues. Having one order avoids circular wait.
|
@maxbrodin Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@maxbrodin Thank you for signing the Contributor License Agreement! |
|
While investigating this I have found out that 1aad565 addressed this in a different place. I now wonder whether |
|
To answer my own question: it seems to be a copy-and-paste artefact. |
|
So the right thing to do is to not acquire a lock on |
…ot need to acquire a lock on this.consumers It most likely was a copy-paste artefact introduced back in 2013-2014. AutorecoveringConnection.maybeDeleteRecordedAutoDeleteQueue does need to lock this.consumers as conditional queue deletion does need to check the number of known consumers on that queue. 1aad565 addressed a potential deadlock caused by the unsafe order of lock acquisitions. In #648 another similar issue was discovered which #649 tried to address by acquiring a lock on this.consumers early. However, exchange cleanup does not need to lock this.consumers as it does not mutate it. Closes #648.
…ot need to acquire a lock on this.consumers It most likely was a copy-paste artefact introduced back in 2013-2014. AutorecoveringConnection.maybeDeleteRecordedAutoDeleteQueue does need to lock this.consumers as conditional queue deletion does need to check the number of known consumers on that queue. 1aad565 addressed a potential deadlock caused by the unsafe order of lock acquisitions. In #648 another similar issue was discovered which #649 tried to address by acquiring a lock on this.consumers early. However, exchange cleanup does not need to lock this.consumers as it does not mutate it. Closes #648. (cherry picked from commit 5c3fce8)
…ot need to acquire a lock on this.consumers It most likely was a copy-paste artefact introduced back in 2013-2014. AutorecoveringConnection.maybeDeleteRecordedAutoDeleteQueue does need to lock this.consumers as conditional queue deletion does need to check the number of known consumers on that queue. 1aad565 addressed a potential deadlock caused by the unsafe order of lock acquisitions. In #648 another similar issue was discovered which #649 tried to address by acquiring a lock on this.consumers early. However, exchange cleanup does not need to lock this.consumers as it does not mutate it. Closes #648. (cherry picked from commit 5c3fce8)
…ot need to acquire a lock on this.consumers It most likely was a copy-paste artefact introduced back in 2013-2014. AutorecoveringConnection.maybeDeleteRecordedAutoDeleteQueue does need to lock this.consumers as conditional queue deletion does need to check the number of known consumers on that queue. 1aad565 addressed a potential deadlock caused by the unsafe order of lock acquisitions. In #648 another similar issue was discovered which #649 tried to address by acquiring a lock on this.consumers early. However, exchange cleanup does not need to lock this.consumers as it does not mutate it. Closes #648. (cherry picked from commit 5c3fce8)
Fixes #648
Ensuring we have only one order of acquiring synchronization on objects
consumersandrecordedQueues. Having one order avoids circular wait.